package com.hk.demo.player.http;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;

import com.zhoug.common.utils.FileUtils;

/**
 * @author: zhoug
 * @since: 2025-06-20
 */
public class DataManager {
    private static final String TOKEN = "TOKEN";
    private static  String BASE_URL = "http://36.134.87.77:9015/";

    private static SharedPreferences mSP;

    public static void init(Application application) {
        mSP = application.getSharedPreferences("default", Context.MODE_PRIVATE);
    }

    public static void setToken(String token) {
        mSP.edit().putString(TOKEN, token).apply();
    }

    public static String getToken() {
        return mSP.getString(TOKEN, null);
    }

    public static void setBaseUrl(String baseUrl) {
        BASE_URL = baseUrl;
    }

    public static String getBaseUrl(){
        return BASE_URL;
    }

    public static String getApiV1(){
        return BASE_URL+"v1/";
    }

}
